
function sendData(){
    console.log($(".input-box")[0].value)
    let content = $(".input-box")[0].value
    send(content)
    
}

function send(content){
    $.get("http://api.tianapi.com/txapi/robot/index",{
        key:"c83d0b00fe2b1c6b0f8d34eb484a5ff2",question:content,userid:"3452653453624354"
    },function(result){
        let htmlright = `<div class='conent-right'>${'我:'+content}</div>`
        if(content.length<8){
            htmlright = `<div class='conent-right-length'>${'我:'+content}</div>`
        }else{
            htmlright = `<div class='conent-right'>${'我:'+content}</div>`
        }
        let htmlleft = `<div class='content-left'>${'机器人:'+result.newslist[0].reply}</div>`
        $(".main-content").append(htmlright)
        $(".main-content").append(htmlleft)
        $(".input-box")[0].value = ""
        var tableHeight = $(".main-content").height();
        document.getElementById("panel").scrollTop = tableHeight;
    })
}

